//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "personal.h"
#include "datamodule.h"
#include "personal_edit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "FIBDataSet"
#pragma link "pFIBDataSet"
#pragma link "FIBQuery"
#pragma link "pFIBQuery"
#pragma resource "*.dfm"
TFormPersonal *FormPersonal;
//---------------------------------------------------------------------------
__fastcall TFormPersonal::TFormPersonal(TComponent* Owner)
        : TForm(Owner)
{
}

//---------------------------------------------------------------------------

void __fastcall TFormPersonal::pFIBDataSetPersonalID_TYPE_PERSONALChange(
      TField *Sender)
{
pFIBDataSetPersonalname_type->Value=pFIBDataSetTypePersonal->FieldByName("name_type")->AsString;
}
//---------------------------------------------------------------------------

void __fastcall TFormPersonal::DBNavigator1BeforeAction(TObject *Sender,
      TNavigateBtn Button)
{
/*
First	nbFirst	Go to the first record
Prior	nbPrior	Go to the previous record
Next	nbNext	Go to the next record
Last	nbLast	Go to the last record
Insert	nbInsert	Insert a blank record
Delete	nbDelete	Delete the current record
Edit	nbEdit	Permit users to edit the current record
Post	nbPost	Post the current record
Cancel	nbCancel	Cancel the current edit
Refresh	nbRefresh	Refresh the data in the dataset
 */
  if(Button==nbInsert)
  {
  //MessageBox(NULL,"!","insert",MB_OK);
  }

}
//---------------------------------------------------------------------------

void __fastcall TFormPersonal::FormActivate(TObject *Sender)
{
    pFIBDataSetPersonal->Active =false;
    pFIBDataSetPersonal->Active =true;
}
//---------------------------------------------------------------------------


void __fastcall TFormPersonal::pFIBDataSetPersonalAfterInsert(
      TDataSet *DataSet)
{
   id_personal = pFIBDataSetPersonalID->AsInteger;
  FormEditPersonal->Show();
}
//---------------------------------------------------------------------------

void __fastcall TFormPersonal::DBGrid1DblClick(TObject *Sender)
{
  id_personal = pFIBDataSetPersonalID->AsInteger;
  FormEditPersonal->Show();
}
//---------------------------------------------------------------------------

